<?php

class Form_RequestForm extends Form_Custom_General {
 
    public function init() {
        
        $req_id = $this->createElement('hidden', 'req_id')
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60"));
        $this->addElement($req_id);

       /* $req_title = $this->createElement('text', 'req_title')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("req_required_title"))))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60", "class" => "span6", "placeholder" => $this->translateObj->translate("req_frm_name")));
        $this->addElement($req_title);
*/
       /* $cust_id = $this->createElement('select', 'cust_id')
                ->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->setAttribs(Array( "class" => "select2"))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("req_required_customer"))));
        $this->addElement($cust_id);
        */
        
        $req_com_id = $this->createElement('select', 'req_com_id')
                ->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->setAttribs(Array( "class" => "select2"))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("req_required_company"))));
        $this->addElement($req_com_id);
        
        $site_id = $this->createElement('select', 'site_id')
                ->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->setAttribs(Array( "class" => "select2"))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("req_required_site"))));
        $this->addElement($site_id);
        
        
        $subj_id = $this->createElement('select', 'subj_id')
                ->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->setAttribs(Array( "class" => "select2"))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("req_required_subject"))));
        $this->addElement($subj_id);

        
        
       $req_date = $this->createElement('text', 'req_date')
                ->setRequired(TRUE)
                ->setValue(date('Y-m-d'))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("req_required_date"))))
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                ->setAttribs(Array("size" => "60", "readonly" =>"readonly", "class" => "span6 input-large datepicker", "placeholder" => $this->translateObj->translate("req_frm_date")));
       $this->addElement($req_date);
        

       
        $req_comment = $this->createElement('textarea', 'req_comment')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("req_required_comment"))))
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                ->setAttribs(Array("size" => "60", "cols" =>"10" ,"rows" =>"3", "class" => "span6", "placeholder" => $this->translateObj->translate("req_frm_comment")));
        $this->addElement($req_comment);
        
        $req_status = $this->createElement('select', 'req_status')
                ->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("req_required_status"))));
        $this->addElement($req_status);
        

        $submit = $this->createElement('submit', 'Save')
                ->setAttribs(Array('title' => "Save changes", 'class' => "btn-glow primary"))
                 ->setLabel($this->translateObj->translate("frm_save"));
        $this->addElement($submit);


        $reset = $this->createElement('reset', 'Reset')
                ->setAttribs(Array('title' => "Save changes and continue to edit", 'class' => "btn-glow primary"))
                 ->setLabel($this->translateObj->translate("frm_reset"));
        $this->addElement($reset);
    }

}